home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Linux
/
Kubuntu 8.10
/
kubuntu-8.10-desktop-i386.iso
/
casper
/
filesystem.squashfs
/
usr
/
sbin
/
update-pangox-aliases
< prev
next >
Wrap
Text File
|
2008-10-21
|
2KB
|
74 lines
#!/usr/bin/perl -w
use strict;
use POSIX;
use vars qw(%UNSUPPORTED_XLFD);
my $PangoAlias = '/var/lib/defoma/pango.d/pangox.aliases';
my $ConfFile = '/etc/defoma/config/pango.conf';
my @clean = ("/usr/bin/defoma-app", "clean", "pango");
my @update = ("/usr/bin/defoma-app", "update", "pango");
# write section
sub write_section {
my $file = shift;
my $family = shift;
open (F, ">> $file");
print F "$family normal normal normal normal \\\n\t\"";
if (exists ($UNSUPPORTED_XLFD {"$family-normal-normal-normal-normal"})) {
print F $UNSUPPORTED_XLFD {"$family-normal-normal-normal-normal"};
print F ",\\\n\t";
}
print F "-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*\"\n\n";
print F "$family italic normal normal normal \\\n\t\"";
if (exists ($UNSUPPORTED_XLFD {"$family-italic-normal-normal-normal"})) {
print F $UNSUPPORTED_XLFD {"$family-italic-normal-normal-normal"};
print F ",\\\n\t";
}
print F "-*-fixed-medium-i-normal--*-*-*-*-*-*-*-*\"\n\n";
print F "$family normal normal bold normal \\\n\t\"";
if (exists ($UNSUPPORTED_XLFD {"$family-normal-normal-bold-normal"})) {
print F $UNSUPPORTED_XLFD {"$family-normal-normal-bold-normal"};
print F ",\\\n\t";
}
print F "-*-fixed-bold-r-normal--*-*-*-*-*-*-*-*\"\n\n";
print F "$family italic normal bold normal \\\n\t\"";
if (exists ($UNSUPPORTED_XLFD {"$family-italic-normal-bold-normal"})) {
print F $UNSUPPORTED_XLFD {"$family-italic-normal-bold-normal"};
print F ",\\\n\t";
}
print F "-*-fixed-bold-i-normal--*-*-*-*-*-*-*-*\"\n\n";
close F;
}
system (@clean) == 0 or die "Failed to clean up for defoma: $?";
system (@update) == 0 or die "Failed to update for defoma: $?";
if ( ! -e $PangoAlias ) {
print "*** You don't have any defomized font packages.\n";
print "*** So we are trying to force to generate pangox.aliases...\n";
do "$ConfFile" or die ("$@\n");
open (F, "> $PangoAlias.bak") or die "Can't create $PangoAlias.bak: $?";
print F "## THIS FILE IS GENERATED BY UPDATE-PANGOX-ALIAS, DO NOT EDIT\n\n";
close F;
## Sans
write_section ("$PangoAlias.bak", "sans");
## Serif
write_section ("$PangoAlias.bak", "serif");
## Monospace
write_section ("$PangoAlias.bak", "monospace");
rename ("$PangoAlias.bak", "$PangoAlias");
}
1;